package pack3;

public class People {
	    public int ID;
	    public String Name;
	    public String Gender;
	    private String Major1;
	    protected String Major2;
	    String Major3;
	    public int getID() {
	        return ID;
	    }
	    public void setID(int id) {
	        this.ID=id;
	    }
	    public String getName() {
	        return Name;
	    }
	    public void setName(String name) {
	        this.Name=name;
	    }
	    public String getGender() {
	        return Gender;
	    }
	    public void setGender(String gender) {
	        this.Gender=gender;
	    }
	    private String getMajor1(){
	        return Major1;
	    }
	    protected String getMajor2(){
	        return Major2;
	    }
	     //String Major3（）{
	     //   return Major3;
	    //}
	    public static void main(String[] args) {
	            People P1 = new People();
	            System.out.println("P1 实例访问："+P1.ID);
	            System.out.println("P1 实例访问："+P1.getID());
	            //父类内部可以访问新建父类对象属性
	        }
	}
